def dfs(my_number, index):
    if (index == 9):
        if (my_number[0] + my_number[1] / my_number[2] + (my_number[3] * 100 + my_number[4] * 10 + my_number[5]) / (
                my_number[6] * 100 + my_number[7] * 10 + my_number[8]) == target):
            count += 1
        return
    else:
        for i in range(index, len(my_number)):
            t = my_number[index]
            my_number[index] = my_number[i]
            my_number[i] = my_number[index]
            dfs(my_number, i + 1)
            t = my_number[index]
            my_number[index] = my_number[i]
            my_number[i] = my_number[index]


count = 0
target = 10
my_number = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]

if __name__ == '__main__':
    dfs(my_number, 0)
    print(count)
    # print('hello')
